package com.foruo.learn.designmode.mediator;

/**
 * 测试类
 * @author GaoYuan
 * @date 2018/11/11 上午8:59
 */
public class TestMe {

    public static void main(String[] args){
        // 创建中介类
        Mediator mediator = new ConcreteMediator();
        // 创建具体同事，并绑定中介
        Colleague colleagueA = new ConcreteColleagueA(mediator);
        Colleague colleagueB = new ConcreteColleagueB(mediator);
        // 分别发送消息
        colleagueA.sendMessage("你好啊，我是A，你是谁？");
        colleagueB.sendMessage("我是B，你呢？");
    }
}
